<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
</head>
<body>
<script type="text/javascript">
    var fruit = new Array(); //长度取决于里面值的个数
    fruit[0] = "apple";
    fruit[1] = "orange";
    fruit[2] = "peach";
    fruit[3] = "banana";
    fruit[4] = "apple";
    fruit.push("pet"); //添加到末尾

    //普通for循环
    // for (let i = 0; i < fruit.length; i++) {
    //     document.write(fruit[i] +"<br>");
    // }

    prompt("请输入您喜欢的颜色")

    for (var any in fruit) { //of 值
        document.write(fruit[any] +"<br>");
    }
    //
    var fruits = ["apple", "orange", "peach", "banana"];
    // alert(fruit)
    // alert(fruits)


    // var v1 = 10,v2 = "10";
    // alert(v1==v2);//== true 值
    // alert(v1===v2);//=== false  类型和值

</script>

</body>
</html>